\subsection{Audio Filters}
%\textbf{HUSK AT SKRIVE OM POLES - Gustav, 23 april}
%\textit{Copy-paste from DSP book:
%"We now have a new kind of transfer function: one with a polynomial in the denominator. At a value of z where the denominator becomes zero, the transfer functio becomes infite. We call those points poles of the trasnfer function or filter."}
%\textbf{Poles are hard to understand, but we kinda need to write about them... - G, 28 May}

An audio filter is used to filter out certain frequencies in a signal. Filters have to uses: they can separate a signal or they can restore a signal \cite{dsp_guide}. It is used to amplify, pass or attenuate (i.e. negative amplification) parts of the signal. Two basic filters are the \textit{low-pass} and \textit{high-pass} filters. These filters allow frequencies above or below the threshold known as the \textit{cutoff threshold} to pass. A low-pass filter simply allows frequencies below the cutoff frequency to pass, while everything above is attenuated. A high-pass filter does the opposite; it allows frequencies above the threshold pass and attenuates frequencies below.

\subsubsection{Real and Ideal Filters}
When attempting to understand the effect that filters have on an audio signal, it is also important to take note of an audio-related technicality, which distinguishes a 'real' filter and an 'ideal' filter. An ideal high-pass filter suppresses frequencies completely at the cutoff threshold, while in a realistic scenario, as represented by a 'real' filter, indicates that there is a short rolloff \cite{filters3}.

From a musical perspective, a low-pass filter emphasizes the bass of an audio signal or song while suppressing the treble; while a high-pass filter allows treble to become more audible while decreasing the presence of the bass.

\subsubsection{Band-Stop and Band-Pass Filters} 
 
The \textit{band-stop filter} or also known as the \textit{band-reject}, \textit{band-elimination}, or \textit{notch filter}, is a type of filter that attenuates a specific range of frequencies while accepting all others. The band-pass filter does the opposite: it accepts a particular range set of frequencies while rejecting all others. Among one of the common applications of a bandstop-filter is to suppress 50 Hz (standard in Europe) power line frequency hums \cite{notchfilter}. An example of band-pass- and band-stop filters can be seen on figure \ref{fig:bandpass}.

\begin{figure}[htbp]
\centering
\includegraphics[width=0.7\textwidth]{images/TheoryDesign/bandpass}
\caption{A visual representation of notch/band-stop/band reject filter \cite{bandpass}.}
\label{fig:bandpass}
\end{figure}

\subsubsection{All-Pass Filter}
	Similar to the low and the high-pass filter is the all-pass filter. The difference in the filter is that all-pass filters do not change the magnitude response of the signal, it only changes the phase in the various frequencies, so they start at different phases \cite{all-pass} See figure \ref{fig:all-passfilter}.

	\begin{figure}[htbp]
		\centering
		\includegraphics[width=1\textwidth]{images/TheoryDesign/All-pass_filter.png}
		\caption{All-pass filter, with magnitude response and phase over frequencies \cite{all-passfig}.}
		\label{fig:all-passfilter}
	\end{figure}

\subsubsection{Equalizer}

While a filter is something that attenuates audio above or below a certain cut-off frequency, an \textit{equalizer} enhances or diminishes certain frequency bands and leaves others unchanged. It is the process of adjusting the balance between frequencies in a signal by strengthening or weakening the energy in a specific set of frequency bands. Figure \ref{fig:equalizer} illustrates what a digital equalizer could look like. An equalizer is very useful if the acoustics of a room, or even a big arena, is causing trouble when outputting sound. Since rooms are rarely exactly alike, they also respond differently to sounds. The equalizer provides the possibility of tweaking the different bands to adjust the sound to the individual rooms or spaces. The number of bands varies a lot and only really depends on the need of the user. The more common equalizers consists of at least two bands and are often found in car stereos and smaller systems, while professional music production utilizes between 20 and 30 bands \cite{equalizer_htg}.

\begin{figure}[htbp]
\centering
\includegraphics[width=0.70\textwidth]{images/Equalizer/equalizer}
\caption{Example of an equalizer \cite{equalizer}.}
\label{fig:equalizer}
\end{figure}
 
An equalizer is built using a series of shelving and peak-filters. The shelving-filters boost/cut the low/high frequency bands, while the peak-filters boost/cut mid-frequency bands. Both are done using a cutoff frequency and a gain \cite{audioEffect_defintion}.

\subsubsection{Comb Filter}
A comb filter is produced when a signal is first delayed and then added back to itself. The delayed signal can also be different from the original. The only requirement is that both signals have similar frequency content. The result of the difference in phase between the waveforms is deep notches occurring regularly in the signal, causing some frequencies to disappear, while the frequencies between these notches are amplified. An example of this effect is shown in figure \ref{fig:7samples}, where a signal consisting of white noise, running on the left and right channel, is illustrated in a linear spectrogram. The R channel is delayed by 7 samples (converted to milliseconds), and then combined back with the L channel. As comparison, figure \ref{fig:original} is an illustration of how a normal white noise signal looks in a spectrogram \cite{combfilter_thestudio}.

\begin{figure}[htbp] \centering
\begin{minipage}[b]{0.45\textwidth} \centering
\includegraphics[width=0.97\textwidth]{images/CombFilter/combFil1} % Venstre billede
\end{minipage} \hfill
\begin{minipage}[b]{0.45\textwidth} \centering
\includegraphics[width=0.97\textwidth]{images/CombFilter/combFil2} % Højre billede
\end{minipage} \\ % Captions og labels
\begin{minipage}[t]{0.45\textwidth}
\caption{Comb Filter with 7 samples delay \cite{combfigure1}.} % Venstre caption og label
\label{fig:7samples}
\end{minipage} \hfill
\begin{minipage}[t]{0.45\textwidth}
\caption{Standard white noise \cite{combfigure2}.} % Højre caption og label
\label{fig:original}
\end{minipage}
\end{figure}

As the delay increases, the number of notches increases as well. This is illustrated in figure \ref{fig:17samples}, where the delay is 17 samples long (converted to milliseconds). The comb filter got its name for its comb like appearance when plotted on a frequency response graph (logarithmic) as seen in figure \ref{fig:combFilter} \cite{combfilter_thestudio}.

\begin{figure}[htbp] \centering
\begin{minipage}[b]{0.45\textwidth} \centering
\includegraphics[width=0.97\textwidth]{images/CombFilter/combFil3} % Venstre billede
\end{minipage} \hfill
\begin{minipage}[b]{0.45\textwidth} \centering
\includegraphics[width=0.90\textwidth]{images/CombFilter/combFil4} % Højre billede
\end{minipage} \\ % Captions og labels
\begin{minipage}[t]{0.45\textwidth}
\caption{Comb Filter with 17 samples delay \cite{combfigure3}.} % Venstre caption og label
\label{fig:17samples}
\end{minipage} \hfill
\begin{minipage}[t]{0.45\textwidth}
\caption{Comb filter on a frequency response graph \cite{combfigure4}.} % Højre caption og label
\label{fig:combFilter}
\end{minipage}
\end{figure}

The comb filter often appears if an object is recorded by multiple microphones placed at different distances from the object. This result is two signals of which the one is delayed, simply because the sound will reach the closest microphone first and then the microphone that is further away from the object afterwards \cite{combfilter_thestudio}. The sound this creates is very often like a metallic resonance, which can dramatically change the tonal color of the signal \cite{combfilter_sweet}.
